home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / k3bverificationjob.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-05-27  |  2.8 KB  |  93 lines

  1. /* 
  2.  *
  3.  * $Id: k3bisoimageverificationjob.h 597651 2006-10-21 08:04:01Z trueg $
  4.  * Copyright (C) 2003 Sebastian Trueg <trueg@k3b.org>
  5.  *
  6.  * This file is part of the K3b project.
  7.  * Copyright (C) 1998-2007 Sebastian Trueg <trueg@k3b.org>
  8.  *
  9.  * This program is free software; you can redistribute it and/or modify
  10.  * it under the terms of the GNU General Public License as published by
  11.  * the Free Software Foundation; either version 2 of the License, or
  12.  * (at your option) any later version.
  13.  * See the file "COPYING" for the exact licensing terms.
  14.  */
  15.  
  16. #ifndef _K3B_VERIFICATION_JOB_H_
  17. #define _K3B_VERIFICATION_JOB_H_
  18.  
  19. #include <k3bjob.h>
  20.  
  21. namespace K3bDevice {
  22.   class Device;
  23.   class DeviceHandler;
  24. }
  25.  
  26.  
  27. /**
  28.  * Generic verification job. Add tracks to be verified via addTrack.
  29.  * The job will then verifiy the tracks set against the set checksums.
  30.  *
  31.  * The different track types are handled as follows:
  32.  * \li Data/DVD tracks: Read the track with a 2048 bytes sector size.
  33.  *     Tracks length on DVD+RW media will be read from the iso9660
  34.  *     descriptor.
  35.  * \li Audio tracks: Rip the track with a 2352 bytes sector size. 
  36.  *     In the case of audio tracks the job will not fail if the checksums
  37.  *     differ becasue audio CD tracks do not contain error correction data.
  38.  *     In this case only a warning will be emitted.
  39.  *
  40.  * Other sector sizes than 2048 bytes for data tracks are not supported yet,
  41.  * i.e. Video CDs cannot be verified.
  42.  *
  43.  * TAO written tracks have two run-out sectors that are not read.
  44.  *
  45.  * The VerificationJob will also reload the medium before starting.
  46.  */
  47. class K3bVerificationJob : public K3bJob
  48. {
  49.   Q_OBJECT
  50.  
  51.  public:
  52.   K3bVerificationJob( K3bJobHandler*, QObject* parent = 0, const char* name = 0 );
  53.   ~K3bVerificationJob();
  54.  
  55.  public slots:
  56.   void start();
  57.   void cancel();
  58.   void setDevice( K3bDevice::Device* dev );
  59.  
  60.   void clear();
  61.  
  62.   /**
  63.    * Add a track to be verified.
  64.    * \param tracknum The number of the track. If \a tracknum is 0
  65.    *        the last track will be verified.
  66.    * \param length Set to override the track length from the TOC. This may be
  67.    *        useful when writing to DVD+RW media and the iso descriptor does not
  68.    *        contain the exact image size (as true for many commercial Video DVDs)
  69.    */
  70.   void addTrack( int tracknum, const QCString& checksum, const K3b::Msf& length = K3b::Msf() );
  71.  
  72.   /**
  73.    * Handle the special case of iso session growing
  74.    */
  75.   void setGrownSessionSize( const K3b::Msf& );
  76.  
  77.  private slots:
  78.   void slotMediaReloaded( bool success );
  79.   void slotDiskInfoReady( K3bDevice::DeviceHandler* dh );
  80.   void readTrack( int trackIndex );
  81.   void slotMd5JobFinished( bool success );
  82.   void slotReaderProgress( int p );
  83.   void slotReaderFinished( bool success );
  84.  
  85.  private:
  86.   K3b::Msf trackLength( int trackNum );
  87.  
  88.   class Private;
  89.   Private* d;
  90. };
  91.  
  92. #endif
  93.